<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
    String path = request.getContextPath();//获取项目根路径
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
                                          + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<title>公告列表 -- </title>
<base href="<%=basePath %>" />
<meta charset="UTF-8"> <!-- meta是元数据 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><!-- 最佳兼容模式方案 -->
<!-- 手机把页面放到一个虚拟的窗口（viewport）里，通常比屏幕宽，这样网页就不用挤在小窗口里，viewport由移动版Safari引入，用来控制viewport的大小和缩放 -->
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum=2.0,user-scalable=yes" />
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
<!-- 禁止浏览器从本地计算机的缓存中访问页面内容:这样设定,访问者将无法脱机浏览 --> 
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="layui/css/layui.css" media="all" />
</head>
<body>
    <table  class="layui-table" id="noticeTable" lay-filter="noticeTable">
    
    <script src="js/jquery.min.js"></script>
    <script src ="layui/layui.js"></script>
    
    <script>
        layui.use(['layer','table','form'],function(){
        	var layer = layui.layer,
        	    table = layui.table,
        	    form = layui.form;
        	
        	table.render({
        		elem:'#noticeTable',
        		title:'公告列表',
        		url:'notice/list',
        		method:'post',
        		cellMinWidth:100,
        		id: "AllTable",
        		request:{
        			pageName : 'PageIndex',
        			limitName: 'PageCount'
        		},
        		cols:[[
        			{field:'title',title:'标题'},
        			{field:'contents',title:'内容'},
        			{field:'adminName',title:'操作人'},
        			{field:'createTime',title:'操作时间'}
        		]],
        		response:{
        			statusCode : 200
        		},
        		parseData : function(res){
        			return{
        				"code" : res.status,
        				"msg" : res.message,
        				"count" : res.count,
        				"data" : res.data
        			};
        		}
        	});
        	
        	setInterval(function(){
              	table.reload('AllTable', {
              		page:{
              			curr:1
              		}
              	});
              },60000);
        });
    </script>
</body>
</html>